package com.csh.subject.common.enums;

import lombok.Getter;

/**
 * 分类类型枚举
 */
@Getter
public enum CategoryTypeEnum {
    //枚举类的对象名称，定义多少个就有多少个对象
    PRIMARY(1,"题目大类"),
    SECOND(2,"二级分类");

    private int code;
    private String msg;

    CategoryTypeEnum(int code , String msg){
        this.code = code;
        this.msg = msg;
    }


    public static CategoryTypeEnum getByCode(int codeValue){
        for(CategoryTypeEnum resultCodeEnum : CategoryTypeEnum.values()){
            if (resultCodeEnum.code == codeValue){
                return resultCodeEnum;
            }
        }
        return null;
    }
}
